<template>
    <div>
        <el-divider v-if="propJson.isAddContent" :border-style="propJson.type" :content-position="propJson.position" :tempInfo="content">
            {{responseInfo}}
        </el-divider>

        <el-divider v-if="!propJson.isAddContent" :border-style="propJson.type">
        </el-divider>
    </div>
</template>

<script setup lang="ts" name="DividerComponent">

import {computed, defineProps, ref} from "vue";
import {doThirdServiceValue} from "@/utils/lowcode/thirdService.ts";

let props = defineProps(['propJson', 'commonParam']);

let propJson = computed(() => {return props['propJson']})
let commonParam = computed(() => {return props['commonParam']})

let responseInfo = ref("")

let content = computed(() => {
    doResponse();
})

function execThen(resValue) {
    if (!resValue && propJson.value.editFlag) {
        responseInfo.value = "暂无数据"
    } else {
        responseInfo.value = resValue
    }
}

async function doResponse() {
    await doThirdServiceValue(propJson.value.contentInfo, commonParam.value, execThen, () => {}, null)
}
</script>

<style scoped lang="less">

</style>